package com.example.administrator.newsdemo;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;

public class DatallActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_datall);
        //获取传过来的意图

       Intent intent= getIntent();
       //从意图中获取数据
       int postion =intent.getIntExtra("position",0);

       String title=intent.getStringExtra("title");
        String comment=intent.getStringExtra("comment");
        String content=intent.getStringExtra("content");
        String type=intent.getStringExtra("type");
        String icon=intent.getStringExtra("icon");
        Toast.makeText(this,""+title+postion+comment+content+type+icon,Toast.LENGTH_SHORT).show();

    }
}
